<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Kra8\Snowflake\HasSnowflakePrimary;

class GroupMember extends Model
{
    //
    use SoftDeletes;
    use HasSnowflakePrimary;
    protected $fillable = [
        'name',
        'phone',
        'avatar_url',
        'address',
        'address_detail',
        'group_id',
        'role',
        'user_id',
        'policy_rule_id'
    ];
    
    public $incrementing = false;
    public function policy_rule(){
        return $this->belongsTo('App\Models\GroupPolicyRule', 'policy_rule_id');
    }
    public function group()
    {
        return $this->belongsTo('App\Models\Group', 'group_id');
    }
    public function user()
    {
        return $this->belongsTo('App\Models\User', 'user_id');
    }
}
